projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4300a1
)
(Frandom): Use just the low 30 bits of random's value.
author
Richard M. Stallman
<rms@gnu.org>
Tue, 26 Jul 1994 19:25:42 +0000
(19:25 +0000)
committer
Richard M. Stallman
<rms@gnu.org>
Tue, 26 Jul 1994 19:25:42 +0000
(19:25 +0000)
src/fns.c
patch
|
blob
|
history
diff --git
a/src/fns.c
b/src/fns.c
index 35cd7e4bca54562302b545ae5ef2e91c51d50524..59dd3b7eeea535d47332e76706d543b6b8e7d36f 100644
(file)
--- a/
src/fns.c
+++ b/
src/fns.c
@@
-71,9
+71,9
@@
With argument t, set the random number seed from the current time and pid.")
it's possible to get a quotient larger than limit; discarding
these values eliminates the bias that would otherwise appear
when using a large limit. */
- denominator = (unsigned long)0x
8
0000000 / XFASTINT (limit);
+ denominator = (unsigned long)0x
c
0000000 / XFASTINT (limit);
do
- val = (random () & 0x
7
fffffff) / denominator;
+ val = (random () & 0x
3
fffffff) / denominator;
while (val >= limit);
}
else